package com.weiaibenpao.demo.chislim.presenter;

import com.weiaibenpao.demo.chislim.base.BasePresenter;
import com.weiaibenpao.demo.chislim.bean.UserSportsInfoBean;
import com.weiaibenpao.demo.chislim.retrofit.RetrofitUtils;
import com.weiaibenpao.demo.chislim.retrofit.rx.NetWorkTransformer;
import com.weiaibenpao.demo.chislim.retrofit.rx.SimpleObserver;
import com.weiaibenpao.demo.chislim.view.NormalRunFView;

/**
 * Created by wlx on 2017/12/7.
 */

public class NormalRunFPresenter extends BasePresenter<NormalRunFView> {

    public void getUserSportsInfo(int userId,int sumSportType,String code){
        RetrofitUtils.getAPIService().getUserSportsInfo(userId,sumSportType,code)
                .compose(new NetWorkTransformer<UserSportsInfoBean>())
//                .compose(new LoadingTransformer<UserSportsInfoBean>(mContext))
                .subscribe(new SimpleObserver<UserSportsInfoBean>(mCompositeDisposable) {

                    @Override
                    public void call(UserSportsInfoBean o) {
                        getView().requestSuccess(o);
                    }
                });
    }
}
